<?php

class Application_Form_Offer extends Zend_Form
{
	public function __construct($options = null)
    {
        parent::__construct($options);
		$this->setMethod("post");
		$this->setEnctype("multipart/form-data");

			
		

		$price = new Zend_Form_Element_Text('price');
		$price->setLabel('Price:')
		->setAttrib('placeholder', 'in €')
		->setRequired(true)
		->setFilters(array('StringTrim','StripTags'))
		->setValidators(array('NotEmpty'))
		->addValidator('float', true, array('locale' => 'en_US'));
		
		$description = new Zend_Form_Element_Textarea('description');
		$description->setLabel('Description:');
		$description->addFilter('StripTags');
		$description->setAttrib('rows', 3);
		
		
		
		$lat = new Zend_Form_Element_Hidden('latitude');
		$lat->setLabel('lat:')
		->setRequired(true)
		->setValidators(array('NotEmpty'));
		$lat->setAttribs(array('class' => 'span2'));
		$lat->setFilters(array('StringTrim','StripTags'));
		
		$lng = new Zend_Form_Element_Hidden('longitude');
		$lng->setLabel('lng:')
		->setRequired(true)
		->setValidators(array('NotEmpty'));
		$lng->setAttribs(array('class' => 'span2'));
		$lng->setFilters(array('StringTrim','StripTags'));
		
		$admin_area_lvl2 = new Zend_Form_Element_Hidden('admin_area_lvl2');
		$admin_area_lvl2->setLabel('Department:');
		$admin_area_lvl2->setAttrib('placeholder', 'department...');
		$admin_area_lvl2->setAttribs(array('class' => 'span2'));
		$admin_area_lvl2->setFilters(array('StringTrim','StripTags'));
		
		$admin_area_lvl1 = new Zend_Form_Element_Hidden('admin_area_lvl1');
		$admin_area_lvl1->setLabel('Region:')
		->setRequired(true)
		->setValidators(array('NotEmpty'));
		$admin_area_lvl1->setAttrib('placeholder', 'Region...');
		$admin_area_lvl1->setAttribs(array('class' => 'span2'));
		$admin_area_lvl1->setFilters(array('StringTrim','StripTags'));
		
		$address = new Zend_Form_Element_Text('address');
		$address->setLabel('Address:')
		->setAttrib('placeholder', 'N°, rue')
		//->setRequired(true)
		->setFilters(array('StringTrim','StripTags'));
		//->setValidators(array('NotEmpty'));
		
		$zipCode = new Zend_Form_Element_Text('zipCode');
		$zipCode->setLabel('Zip code:')
		//->setRequired(true)
		->setFilters(array('StringTrim','StripTags'));
		//->setValidators(array('NotEmpty'));
		
		$city = new Zend_Form_Element_Text('city');
		$city->setLabel('City:')
		//->setRequired(true)
		->setFilters(array('StringTrim','StripTags'));
		//->setValidators(array('NotEmpty'));
		
		$country = new Zend_Form_Element_Text('country');
		$country->setLabel('Country:')
		//->setRequired(true)
		->setFilters(array('StringTrim','StripTags'));
		

		$elements = array( $price, $description, $address, $zipCode, $city,$country,$lat,$lng,$admin_area_lvl2,$admin_area_lvl1);
		$this->addElements($elements);

		//$this->setDecorators( array( array('ViewScript', array('viewScript' => 'login/loginform.phtml'))));
	}
}